unit UnitAppface ;

interface

uses
types;

function SkinStart(SkinFile:PChar;nDefWinType:Integer;
CheckSum:PChar;nType:Integer;nLen:Integer;szResType:PChar):LongBool; stdcall ;
function SkinStartW(SkinFile:PWideChar;nDefWinType:Integer;
CheckSum:PWideChar;nType:Integer;nLen:Integer;szResType:PWideChar):LongBool; stdcall ;
function SkinThread():Integer; stdcall ;
function SkinWindowSet(hWnd:THandle;nSkinType:Integer):LongBool; stdcall ;
function BkCreate(nBkType:Integer):THandle; stdcall ;
function BkDelete(nBkType:Integer):Integer; stdcall ;
function BkDraw(bkHandle:THandle;dcTarget:THandle;rcTarget:LongWord;nReserved:Integer):LongBool; stdcall ;
function SkinRemove():Integer; stdcall ;
function SkinWindowSetEx(hWnd:THandle;nSkinType:Integer;nResourceId:Integer;
nType:Integer;SkinFile:PChar;nLen:Integer;szResType:PChar):Integer; stdcall ;
function SkinWindowSetExW(hWnd:THandle;nSkinType:Integer;nResourceId:Integer;
nType:Integer;SkinFile:PWideChar;nLen:Integer;szResType:PWideChar):Integer; stdcall ;

//--------------------------------------------------------------------------
//Defines
//The client frame window will receive this message when user click a frame button
const WM_FRAME_BUTTON   =     $764 ;

//Send this message to the hyperlink control to modify the URL
const WM_HYPERLINK_URL    =   $765 ;

//Send this message to display a transparent GIF on a SKIN_CLASS_STATIC control
const WM_TRANSPARENT_GIF  =   $765 ;

//Give users a chance to do custom draw for the skinned windows ,
//user can draw anything they want on the AppFace background in the callback function body .
//typedef int (CALLBACK *PAINTCUSTOMPROC)(HDC , HWND) ;


  //For WM_FRAME_BUTTON  WPARAM
const FRAME_BUTTON_MAX         =    1  ;
const FRAME_BUTTON_RESTORE     =    2  ;
const FRAME_BUTTON_MIN         =    3  ;
const FRAME_BUTTON_CLOSE       =    4  ;

  //For custom frame button
const FRAME_BUTTON_CUSTOMBASE  = $200  ;           //The custom control button

const FB_COMMAND_REMOVE        =    0   ;
const FB_COMMAND_ENABLE        =    1   ;
const FB_COMMAND_DISABLE       =    2   ;
const FB_COMMAND_CHECK         =    3   ;
const FB_COMMAND_UNCHECK       =    4   ;


//Load URF,and skin windows automatically
const GTP_LOAD_FILE            =    1   ;
const GTP_LOAD_MEMORY          =    2   ;
const GTP_LOAD_RESOURCE        =    3   ;
//Load the URF into memory only ,but do not skin any windows,
//until users call SkinWindowSet
const GTP_LOAD_FILE_ONLY       =    4   ;
const GTP_LOAD_MEMORY_ONLY     =    5   ;
const GTP_LOAD_RESOURCE_ONLY   =    6   ;

//The window was created by which development tool
const WINDOW_TYPE_AUTOFILTER   =    0   ;//Auto detected by appface
const WINDOW_TYPE_SDK          =    1   ;
const WINDOW_TYPE_VC           =    1   ;
const WINDOW_TYPE_VB6          =    2    ;
const WINDOW_TYPE_BCB          =    3   ;
const WINDOW_TYPE_DELPHI       =    3   ;
const WINDOW_TYPE_NET          =    4   ;

//Windows skin type,used for SkinWindowSet function
const SKIN_CLASS_NOSKIN         =   0   ;//Do not skin a window ,but allocate the needed resource for it

  //Windows
const SKIN_CLASS_AUTOFILTER     =   1   ;//AppFace skin this window automatically

const SKIN_CLASS_PAUSESKIN      =   2   ;//Pause skin for a special window,but do not free resource
const SKIN_CLASS_REDOSKIN       =   3   ;//Redo skin from pause state
const SKIN_CLASS_REMOVESKIN     =   4   ;//Unskin a window and remove all the allocated skin resource for it at the same time
const SKIN_CLASS_NOSKINEX       =   5   ;//Unskin a window and all the child windows of it


const SKIN_CLASS_UNKNOWN        =   6   ;
const SKIN_CLASS_AUTOFILTEREX   =   7   ;
const SKIN_CLASS_SCROLLWIN      =  10    ;
const SKIN_CLASS_SCROLLWINBORDER=  11   ;
const SKIN_CLASS_FRAMEWIN       = 101   ;
const SKIN_CLASS_FRAMEDIALOG    = 102   ;
const SKIN_CLASS_INSIDEDIALOG   = 103   ;
const SKIN_CLASS_MDICLIENT      = 104   ;
const SKIN_CLASS_SCROLLPANEL    = 105   ;
const SKIN_CLASS_FRAMEBACKGROUND= 106   ;

  //Controls
const SKIN_CLASS_COMBOBOX       = 201   ;
const SKIN_CLASS_DATETIME       = 202   ;
const SKIN_CLASS_HEADER         = 203   ;
const SKIN_CLASS_GROUPBOX       = 204   ;
const SKIN_CLASS_IMAGEBUTTON    = 205   ;
const SKIN_CLASS_MENU           = 206   ;
const SKIN_CLASS_PROGRESS       = 207   ;
const SKIN_CLASS_PUSHBUTTON     = 208   ;
const SKIN_CLASS_SCROLLBAR      = 209   ;
const SKIN_CLASS_SLIDER         = 210   ;
const SKIN_CLASS_SPIN           = 211   ;
const SKIN_CLASS_SPILTER        = 212   ;
const SKIN_CLASS_STATUSBAR      = 213   ;
const SKIN_CLASS_TAB            = 214   ;
const SKIN_CLASS_TEXT           = 215   ;
const SKIN_CLASS_TOOLBAR        = 216   ;
const SKIN_CLASS_TOOLBAREX      = 217   ;
const SKIN_CLASS_TOOLBARPANEL   = 217   ;
const SKIN_CLASS_PANEL          = 218   ;
const SKIN_CLASS_PANELEX        = 219   ;
const SKIN_CLASS_PANELELIXIR    = 220   ;
const SKIN_CLASS_HYPERLINK      = 221   ;
const SKIN_CLASS_STATUSBAR_VB6  = 222   ;
const SKIN_CLASS_SHAPEWIN       = 223   ;
const SKIN_CLASS_CHECKBUTTON    = 224   ;
const SKIN_CLASS_RADIOBUTTON    = 225   ;
const SKIN_CLASS_READONLYEDIT   = 226   ;

const SKIN_CLASS_FRAMEBTN       = 227   ;
const SKIN_CLASS_SLIDEREX       = 228   ;

const SKIN_CLASS_EDITBOX        =  229  ;
const SKIN_CLASS_LISTBOX        =  230  ;
const SKIN_CLASS_COMBOBOXEX     =  231  ;
const SKIN_CLASS_LISTVIEW       =  232  ;
const SKIN_CLASS_TREE           =  233  ;

const SKIN_CLASS_TOOLBARREAL    =  301  ;

 //Only for SkinWindowSetEx
const SKIN_SET_TRANSPARENT      = 601   ;
const SKIN_SET_THEME_COLOR      = 602   ;
const SKIN_SET_EFFECT           = 603   ;
const SKIN_SET_REDRAW           = 604   ;

const SKIN_SET_PAINTCUSTOMPROC  = 605   ;
const SKIN_SET_NCPAINTCUSTOMPROC= 606   ;

const SKIN_SET_SPECIAL_TOOL     = 610   ;

//Only for VB6 scrollbar control
const SKIN_SET_VB6_SCROLL_INFO  = 611   ;


const SKIN_SET_UNSKIN           = 660   ;
const SKIN_SET_UNICODE_URF_FONT = 661   ;

//Pause all the skin functions of AppFace for all windows in the target process,
//SKIN_CLASS_PAUSESKIN only pause skin functions for one special window .
//These two parameters do not release the allocated resource both.
const SKIN_SET_PAUSESKIN        = 662   ;

//Restore skin functions from SKIN_SET_PAUSESKIN state
const SKIN_SET_REDOSKIN         = 663    ;

//Indicate skin or not skin VC static control automatically
const SKIN_SET_VCLABEL          = 664    ;

//To control the custom frame button
const SKIN_SET_FRAMEBTN         = 665    ;

//Create bk object from another URF
const SKIN_GET_BK               = 701   ;


//

  //Only for SKIN_SET_EFFECT
const EFFECT_IN_SPIN             =  2   ;
const EFFECT_IN_VORTEX           =  3   ;
const EFFECT_IN_SCATTER          =  4   ;
const EFFECT_IN_STAR             =  5   ;
const EFFECT_IN_RAZZLE           =  6    ;

const EFFECT_OUT_SPIN            = 52   ;
const EFFECT_OUT_VORTEX          = 53   ;
const EFFECT_OUT_SCATTER         = 54   ;
const EFFECT_OUT_STAR            = 55   ;
const EFFECT_OUT_RAZZLE          = 56   ;


  //Background type
const BK_DIALOGPANEL             =  1   ;
const BK_MDICLIENT               =  2   ;
const BK_MDICHILD                =  3   ;
const BK_SPLITTER                =  4   ;
const BK_STATUSBAR               =  5   ;
const BK_MENUBARBK               =  6   ;
const BK_MENUBARHOVER            =  7   ;
const BK_MENUBARDOWN             =  8   ;
const BK_MENU_BK                 =  9   ;
const BK_MENU_HOVER              = 10   ;
const BK_SCROLL_BK               = 11   ;
const BK_SLIDER_CHANNEL_H        = 12   ;
const BK_SLIDER_CHANNEL_V        = 13   ;
const BK_PROGRESS_H_NORMAL       = 14   ;
const BK_PROGRESS_V_NORMAL       = 15   ;
const BK_PROGRESS_H_OVER         = 16   ;
const BK_PROGRESS_V_OVER         = 17   ;

const BK_IMAGE_ARROW         =   1001   ;
const BK_CUSTOM              =  10000   ;

const ARROW_UP_NORMAL            =  1   ;
const ARROW_UP_DOWN              =  2   ;
const ARROW_DOWN_NORMAL          =  3   ;
const ARROW_DOWN_DOWN            =  4   ;

//--------------------------------------------------------------------------

implementation

function SkinStart;external 'appface.dll' name 'SkinStart' ;
function SkinRemove;external 'appface.dll' name 'SkinRemove' ;
function SkinThread;external 'appface.dll' name 'SkinThread' ;
function SkinWindowSet;external 'appface.dll' name 'SkinWindowSet' ;
function SkinStartW;external 'appface.dll' name 'SkinStartW' ;
function BkCreate;external 'appface.dll' name 'BkCreate' ;
function BkDelete;external 'appface.dll' name 'BkDelete' ;
function BkDraw;external 'appface.dll' name 'BkDraw' ;
function SkinWindowSetEx;external 'appface.dll' name 'SkinWindowSetEx' ;
function SkinWindowSetExW;external 'appface.dll' name 'SkinWindowSetExW' ;


end.
